
#import eq.core;
#import eq.debug;
import d as d;
import s.as;
import pub.s.e as w;
#w.a[s];
#3=5;
w.a = 5;
#aa = 5;
aaa[100,20];
#a;
#$a;
print("============0x================");
#a=0x65;
b=a;
b=$a;
const c=5,a=4;
print("============switch================");
switch("3"){
case 1:{
print("1");}
case "1":{
print("2");}
case 2+3,"2":{
print("3");}
default:{
#break;
print("default");
}
}
print("============array================");
a=[];
print("============try================");
i=0;
try{
    print("i.."+0);
}catch(e){
    print("e.."+e);
    print("e.."+a);
}finally{

  print("finally");
  print("finally1");
}
#print("e.."+e);
print("============while================");
i=0;
while(true){
    if(i==2) {i++;continue;}
    if(i==5) {break;}
    print("i.."+i);
    i++;
   # return 0;
}
print("============for================");
for(i=1;i<8;i++){
    if(i==2) {continue;}
    if(i==5) {break;}
    print("i.."+i);

}
i=0;
for(;;){
    if(i==2) {i++;continue;}
    if(i==5) {break;}
    print("i.."+i);
    i++;
}
print("============if================");
i=9;
if((i=5,false)){
    print("if");
}elsif(true){

print("else1");
print("i2.."+i);
}elsif(true){
print("else2");
}
else{
    print("else");
}
print("i1.."+i);
print("============================");#||(result.type==StatementResultType.RETURN_STATEMENT_RESULT)
{
a = 5;
$c = 4;
$a = 5;
const f=4;
print("3.0 - 5.0.." + (a - 5.0) + "\n");
#return 0;
print("return 1");
{
d=0;
a=1;
f=5;
print("f.." + (f) + "\n");
print("3.0 - 5.0.." + (a - 5.0) + "\n");
print("3.0 - 5.0.." + (d - 5.0) + "\n");
#return 0;
print("return 0");
}
#return 2;
print("return 2");
f=3;
print("f.." + (f) + "\n");
print("3.0 - 5.0.." + (a - 5.0) + "\n");
#print("3.0 - 5.0.." + (d - 5.0) + "\n");
#continue;
#break;
print("3.0 + -5.0.." + ($c + -5.0) + "\n");
}
for (i = 0; i < 5; i++) {
    s=4i;

}


a=[3,a,c,4;5,6];
d =[3,a,c,4;5,6];
print("a.." + (a) + "\n");
const b=[3,a,2,4;5,6];
print("a.." + (a) + "\n");
print("b.." + (b) + "\n");
print("b.." + (-b) + "\n");
print("b.." + (b) + "\n");
print("~2.." + (~-3) + "\n");
print("~2.." + (!(1>0)) + "\n");
print("~2.." + (1^2) + "\n");
print("~2.." + (c--) + "\n");
print("~2.." + (c) + "\n");
a=2.2+5.6i;
#continue;
#break;
print("~2.." + (a--) + "\n");
print("~2.." + (a) + "\n");
print("~2.." + (a++) + "\n");
print("~2.." + (a) + "\n");
try{

}catch(e){

}finally{

}
print("=========function===================");

print(g(3+6));
h=g;
#print(h());
function g(d){

    d +=3;
    print("g.."+d);
    #break;
    f=s.aa("123");
    return "23";
}

function aa(){
print("aa..");
}

print("=========function===================");
d=3;
print("a.."+d);
d+=3;
print("a.."+d);
d-=3;
print("a.."+d);
d*=3;
print("a.."+d);
d=9.0;
d/=3;
print("a.."+d);
print("aa.."+(d%3));
d%=3;
print("a%.."+d);
d=3;
print("a.."+d);
d&=1;
print("a&.."+d);
print("a|.."+(d|3));
d|=3;
print("a|.."+d);

d^=12;

print("a^.."+d);

a=s.w;

#load 增加了全局变量a
function load(){
  a=10;
}

print("====test variable====");

b = 4;
b = a; #load中定义
$b = $b;


print("====test function====");
 fun1=s.print2;
print("====a====");
#fun1(123,123,"qwe12",true,false,null);
$fun1(123,123,"qwe12",true,false,null);

#s.a;
#a.b();
#s.print1();
s.print2("12");
#s.a();
s.print2;

fun1=print;
#fun1(123,123,"qwe12",true,false,null);
$fun1(123,123,"qwe12",true,false,null);
#b.c;
function a(){
  fun1=s.print2;
print("====a====");
#fun1(123,123,"qwe12",true,false,null);
$fun1(123,123,"qwe12",true,false,null);
$fun1(123,123,"qwe12",true,false,null);
}

function b(c,d){
  $fun1(123,123,"qwe12",true,false,null);
  print("====b====");
#  print(d);
$fun1(123,123,"qwe12",true,false,null);
}

function c(a,b,c){
    fun1=s.print2;
$fun1(123,123,"qwe12",true,false,null);
  print("====c====");
$fun1(123,123,"qwe12",true,false,null);
}

a();
a();
b(1,3,4);
b(1);
c(1,3,4);

print("============const================");
a=3;
const b = 4;
#const a = 45;
#const a;
const c = 45,e="qw";
print(c,e);
c = "qw";
print(c,e);
#c=a.s;
d=s.print2;
$d(123);
print(d);

function f(){
 # const a;
 const a = 123,g="12";
  print("==f==");
  print(a,$a);
}

f();
#print(g);

print("============block================");
a = 3;
const d = 5;

{
  #print("a",a);
  print("a",$a);
  b = 3;
  const c = 5;
  d = 45;
  $a = 34;
  $d = 34;
  print("d",$d);
  print("d",d);
}

print("a",a);
print("a",$a);
print("d",d);
#print("b",b);
#print("c",c);

print("============block1================");

function test(){
  #print("a",a);
  print("a",$a);
  b = 3;
  const c = 5;
  d = 45;
  $a = 34;
   $d = 34;
  print("d",$d);
  print("d",d);
}

test();
print("a",a);
print("a",$a);
print("d",d);
#print("b",b);
#print("c",c);

print("============block2================");

function test1(){
a1 = 3;
const d1 = 5;

{
  # print("",);
  print("a1",a1);
  print("d1",d1);
  a1 = 4;
  d1=6;
  c1=5;
}
  print("a1",a1);
  print("d1",d1);
  print("c1",$c1);
}

test1();
print("==break and continue==");
{
print("1");
continue;
print("2");
}
print("3");
{
print("4");
break;
print("5");
}
print("6");

print("==if==");
a=3;
b=true;
c=false;
if(b){

}

if(b){

}elsif(b){

}elsif(b){
  
}

if(b){

}elsif(b){

}elsif(b){
  
}else{

}

if(b){
print("if");
}

if(c){
print("if");
}elsif(c){
print("elsif");
}elsif(b){
  print("elsif1");
}

if(c){
print("if");
}elsif(c){
print("elsif");
}elsif(c){
  print("elsif");
}else{
print("else");
}
print("==if==");
b=true;
c=false;
a=12;
if(b){
  print($a);
  a=6;
  f=8;
  print(f);
}
print(a);
#print(f);

function test(){
  c=0;
  b=true;
  if($c){
    print(c);
    d=23;
    c=23;
  }elsif($c){
    print(c);
    d=23;
     c=24;
  }else{
    print(c);
    d=23;
     c=25;
     {
       print(c);
       c=28;
     }
  }
  print(c);
  print(d);

}

test();
print(c);

print("===while===");
c=23;
b=true;


while(b){
  d=56;
  #continue;
  print($c);
  $b=false;
}
function test(){
  b=true;
  while(b){
  d=56;
  #continue;
  break;
  print($c);
  b=false;
}
}
test();
print(c,d);

print("===for===");
a=0;
for(;;){
break;
print(123);
break;
}
print("===for1===");
for(;false;a){
b=0;
}
print(b);
function load(){
  c1=288;
}
function load(){
    a = 5;
}

print("===return===");

function a(){

  return;
}

b=15;
function aa(){

  return b;
}

function aaa(){

  return "123";
}
function aaaa(){

  return aaa;
}
print(a());
#print(aa());
print(aaa());
print(aaaa());
c=aaaa();
print($c());

print("==switch===");

a="123";
switch(a){
case 1:{
print(1);
}
case "123",34,true:{
  c=12;
  print(4);
  print($a);
}

default:{
print("default");
}
}

print(c);

print("==try===");

a=90;
e=100;

function test(){
#e=50;
try{
  e=100;
  print(e);
  print(a);
  a=30;
  print("try1");
}catch(ew){
  print("catch");
  print(e);
}
print(e);
}
test();


try{
print("try2");
}catch(e){
print(e);
}finally{
print("finally2");
}
print(a);

print("==Complex===");
a=12i;
print(a);
a=0;
print(a);

print("==comma===");
a=(12i,15i);
print(a);

print("==Expression===");
a=10;
print(a!=10);
print(a==10);
print("==Expression1===");
#print(12||a);
#print(false||a);
print(1,true||a);
print(2,false||true);
print(2,false||false);
#print(3,true&&a);
print(3,true&&false);
print(4,true&&true);
print(4,false&&aa);

print("====minus====");

a=10;
print(a);
print(-a);
#print(~1.1);
print(~a);
#print(!10);
print(!true);
print(null);
a++;
print(a);
print(a++);
print(a++);
print(a++);
#print(++aa);
print(a);
print("====minus1====");
print(a);
a--;
print(a--);
print(a--);
print(a--);
#print(++aa);
print(a);

a=[1,2,true;false,null,"123"];
b=[];
c=[1,2,true,false,null,"123";1,2,true;false,null,1;2,true,false;2,true,12,true];
c=[a,2;23;45];
f=10;
#print(f[1]);
print(a);
print(b);
print(c[1]);
print(c[1,2,0]);
print(c[0][1]);
d=2;
print(c[d]);
print($c[d]);
#print(w.c[1]);
print(s.c[1]);


###  待处理d=[1,2;1,[1];2;[2,3;4;[3,4;5]]];

d=[1,2,3;4,5;56,true];
#d=7;
print(d);
print(d[1]);
print(d[1i,8,90,2,1]);#从右往左生效
#print(d[1i]);
print(d[3]);
#print(d[3][2]);
#print(d[3][2][1]);

print("==array==");

a=[1,2];
b=[3,a;5];
d=[1,a,3;4,b;56,true];

print(d);
print(d[0,1]);
print(d[1,1]);
print(d[0,1][0,1]);
print(d[1,1][0,1][0,1]);

print(d[2]);

print(true == 5);

print(true != 5);

#print(null + 5);
#print(true + 5);

print("12"+"23");
print("12"+true);
print("12"+23);
print("12"+23i);
print("12"+'23i');
print("12"+null);
#print("12"-"23");
#'qw'+123;

print("===>int double +");

print(1+1);
print(1.0+1);
print(1+1.0);

print(1+1+3i);
print(1.0+1+3i);
print(1.0+1+3.2i);

c=[4,6];
b=[1,2i,c];
a=[1,2i,3;b,5i,6];
print(1+a);
print(1+a[1,1]);
print("===>int double -");

print(1+1-3i);
print(1.0+1-3i);
print(1-a);
print(1-a[1,1]);

print("===>int double *");
c=[4,6];
b=[1,1+2i,c];
a=[1,2i,3;b,5.0i,6];
print(0*5i);
print(5*6);
print(55*6.0);
print(a);
print(2*a);
print(0*"123");
print(2*a[1,1]);

print("===>int double /");

print(0/0);
print(0/5i);
print(0/"5i");
print(5/0);

print(2/a);
print(2/a[1,1]);

print("===>int double mod");
c=[4,6];
b=[1,1+2i,c];
a=[1,2i,3;b,5.0i,6];

#print(0%0);
print(0%5i);
print(0%"5i");
#print(5%0);

#print(2%a);
print(2%c);
print(2%a[0,0]);
print("===>int double &");
print(5&5);
print(0&5);
print(5&0);

#print(5.0&0);
#print(5&0.5);

#print(5&b);
print(5&c);
print("===>int double |");
print(5|5);
print(0|5);
print(5|0);

#print(5.0|0);
#print(5|0.5);

#print(5|b);
print(5|c);

print("===>int double ^");
print(5^5);
print(0^5);
print(5^0);

#print(5.0^0);
#print(5^0.5);

#print(5^b);
print(5^c);

print(~5 & 0xF);

print("===>int double > ");

print(5>5i);
print(5>(1+5i));
print(5>4);
print(5>b);

print("===>int double >= ");

print(5>=5i);
print(5>=(1+5i));
print(5>=4);
print(4>=b);

print("===>int double < ");

print(5<5i);
print(5<(1+5i));
print(5<4);
print(4<b);

print("===>int double <= ");

print(5<=5i);
print(5<=(1+5i));
print(5<=4);
print(4<=b);

print("===>Complex + ");

print(5i+2);
print(2+5i+(1-5i));
print(2.0+5i+(1.0-5i));
print(2.6+5i+(1.4-5i));

print(5i+a);

print("===>Complex - ");
print(5i-(1.4-5i));
print(5i-2);
print(2+5i-(1+5i));
print(2.0+5i-(1.0-5i));
print(2.6+5i-(1.4-5i));

print(5i-a);

print("===>Complex * ");
print(5i*0);
print(5i*2);
print((2+5i)*(2-5i));
print(2.0+5i*(1.0-5i));
print(2.6+5i*(1.4-5i));

print(5i*a);

print("===>Complex / ");
print(5i/0);
print(5i/2);
print((2+5i)/(2-5i));
print(2.0+5i/(1.0-5i));
print(2.6+5i/(1.4-5i));

print(5i/a);

print("===>Complex % ");

print(1==1);
print((1i+1)==(2+1i));
print((1i+1)!=(2+1i));

print("===>Complex >= ");

print((2>(1i)));
print((1i+1)>(2+1i));
print((1i+1)>(2));
print((1i+3)>(2+1i));
print((1i+2)>(2));
print((1i+1)>=(2+1i));
print((1i+1)>=(2));
print((1i+3)>=(2+1i));
print((1i+2)>(2+1i));
print((1i+2)>=(2+1i));

print((1i+2)>a);
print((1i+2)>=a);

print("===>Complex <=");

print((1i+1)<(2+1i));
print((1i+1)<(2));
print((1i+3)<(2+1i));
print((1i+2)<(2));
print((1i+1)<=(2+1i));
print((1i+1)<=(2));
print((1i+3)<=(2+1i));
print((1i+2)<(2+1i));
print((1i+2)<=(2+1i));

print((1i+2)<a);
print((1i+2)<=a);

#print(s.b);
print(s.print2("123"));
#print(s.a("123"));
print(s.c);
#print(s.$c);
s.c[0,0]="123";
s.c[1,0]="456";
print(s.c);
print(s.a);
s.a=true;
print(s.a);
s.a=[];
print(s.a);
s.a=false;
print(s.a);
s.a=8+9i;
print(s.a);
s.a+=8+9i;
print(s.a);
print("const ");
print(s.b);
s.b=true;
print(s.b);
s.b=[];
print(s.b);
s.b=false;
print(s.b);
s.b=8+9i;
print(s.b);


c=[4,6];
b=[1,1+2i,c];
a=[1,2i,3;b,5.0i,6];

print("module test");
#s.a=8+9i;
print(s.a);
s.c[0,0]=45;
s.a+=8+9i;
print(s.a);
s.a-=8+9i;
print(s.a);
test();


function test(){
print("module  function test");
a=90;
s.print2(123);
print(s.a);
print(a);
print($a);
s.c[0,0]=566;
print(s.c);
}

b=[1,1+2i,c];
a=["1",2i,3;b,5.0i,6];
d=90;
print("array test");

#print(d++);
#print(c[0,0]);

print(c[0,1]--);
print(b[0,1]--);
#print(a[0,0]--);

print(c++);
print("===>array +");
print(c+1);
print(c+1.0);
print(c+1i);
print("===>array -");
print(c-1);
print(c-1.0);
print(c-1i);
print("===>array *");
print(c*1);
print(c*1.0);
print(c*1i);
print("===>array /");
print(c/1);
print(c/1.0);
print(c/1i);


print("===>array &");
print(c&1);
#print(c&1.0);
#print(c&1i);

print("===>array |");
print(c|1);
#print(c|1.0);
#print(c|1i);

print("===>array ^");
print(c^1);
#print(c^1.0);
#print(c^1i);

print("===>array >");
print(c>4);
print(c>4.0);
print(c>4i);

print("===>array >=");
print(c>=4);
print(c>=4.0);
print(c>=4i);

print("===>array <");
print(c<4);
print(c<4.0);
print(c<4i);

print("===>array <=");
print(c<=4);
print(c<=4.0);
print(c<=4i);

print("===>array %");
print(c%4);
print(c%4.0);
#print(c%4i);

a=[3,4];
e=[2,5];
c=[4,a;7i];
d=[5i,45;8];
print("===>array %");

#print(6+c);
print(c+d);
print(c-d);
#print(c&d);
#print(c|d);
#print(c^d);
print(a&e);
print(a|e);
print(a^e);
print(a%e);

print(a==e);
print(a>e);
print(a>=e);
print(a<e);
print(a<=e);

print(c.*d);
print(c./d);
print(c*d);
print(c/d);

#d=[4,6];
#c=[4,"6",8i,true,d];

a=[3,4];
e=[2,4];
#c=[4,a;7i];
c=[4,a;7,e];
d=[5i,45;8];
print("===>array %");

e=[true];
a=[true,false];
c=[true,e,false;a];
print("===>todo");
#print(~c);
print(!c);

#print(t.min());

#print(t.min(-1i,[2],-0,12,0)); #0
#print(t.max(-1,2,-0,"12",0)); #2

print(!-8);
print(!6i);
print(!(3+4i));

print(t.getModulo(3+5i));
print(t.getModulo(-1i,[2],"-0",-12,3+4i));

#print(![1,2,3]);
print(![true,true,true]);
print(![1,2,3;1,2,3;1,2,3]);
print(![1,2,3;1i,2,3;1,2,3]);

for(i=0;i<4;i++){
  print(t.randomInt(10));
  print(t.randomInt(10,2));
  print(t.randomInt(10,2i));
  print(t.randomInt("10",2));
  print(t.randomInt());
  print("------------------");

}

for(i=0;i<4;i++){
  print(t.randomDouble(10));
  print(t.randomDouble("10",2));
  print(t.randomDouble());
  print("------------------");

}

for(i=0;i<4;i++){
  print(t.randomBool(10));
  print(t.randomBool("10",2));
  print(t.randomBool());

  print("------------------");

}

print(t.pow(2,2));
print(t.pow(-2,2));
print(t.pow(2,-2));
print(t.pow(-0.2,2));
print(t.pow(2,-0.2));
print(t.pow(0,2));
print(t.pow(2,0));
print(t.pow(2,0.2));
print(t.pow(0.2,2));

print(t.atan2(2,2));
print(t.atan2(-2,2));
print(t.atan2(2,-2));
print(t.atan2(-0.2,2));
print(t.atan2(2,-0.2));
print(t.atan2(0,2));
print(t.atan2(2,0));
print(t.atan2(2,0.2));
print(t.atan2(0.2,2));

print(t.atan2(t.pi/2,2));
print(t.atan2(0.2,t.pi/2));

print(t.sin(2,2));
print(t.sin(-2,2));
print(t.sin(2,-2));
print(t.sin(-0.2,2));
print(t.sin(2,-0.2));
print(t.sin(0,2));
print(t.sin(2,0));
print(t.sin(2,0.2));
print(t.sin(0.2,2));

print(t.sin(t.pi/2,2));
print(t.sin(0.2,t.pi/2));

a="E:\\zhouyu\\HappyNewYear\\tools\\fengyu\\plugins\\eq\\example\\testFlex.eq";
b="E:\\zhouyu\\HappyNewYear\\tools\\fengyu\\plugins\\eq\\example\\s.eq";

#print(t.exists(a,print));

c = t.existsSync(a);
d = t.existsSync(b);
print(c);
print(d);

#t.readAsBytes(c,print);
#e = t.readAsBytesSync(c);
#e=[100,1000,60,566666,6];
#print(t.writeAsBytesSync(d,e));
#t.writeAsBytes(d,e);
#t.writeAsBytes(d,e,print);
#print(e);

#t.readAsString(c,print);
e = t.readAsStringSync(c);
#print(t.writeAsStringSync(d,e));
e="qwedqwe的热吻结尾热舞偶尔会";
print(t.writeAsString(d,e,print));
#print(e);

#t.readAsLines(c,print);
#e = t.readAsLinesSync(c);
#print(e);
